const Sequelize = require('sequelize')
const models = require('../models')

class BaseService {
  static model = models
  static Sequelize = Sequelize
  // static pageSize = 30

  static success(data, message, code) {
    return {
      code: code || 10000,
      message: message || 'success',
      data
    }
  }

  static error(message, code, data = null) {
    return {
      code: code || -1,
      message: message || 'error',
      data
    }
  }
}
let data1 = {
  week: ['04.01', '04.08', '04.15', '04.22', '04.29', '05.06', '05.13'],
  dataY: [70, 77, 80, 81, 88, 90, 95]
}
let data2 = {
  week: ['04.01', '04.08', '04.15', '04.22', '04.29', '05.06', '05.13'],
  dataUp: [ 2, 1, 2, 3, 4, 5, 1, 2, 3, 5, 5, 5],
  dataDown: [ 1, 1, 1, 2, 2, 1, 3, 4, 3, 2, 2, 1],
}
let visualData = {data1, data2}
module.exports = BaseService
module.exports.visualData = visualData
